using System.Collections.Generic;
using System.Text.Json.Serialization;
using JlPay.Sdk.Models;
using JlPay.Sdk.Core;

namespace JlPay.Sdk.Models.Openmerch.Query
{
    /// <summary>
    /// 商户基本信息查询响应
    /// </summary>
    public class MerchBaseInfoQueryResponse : StandardResponse, ISensitiveFieldsProvider
    {
        // 基础信息
        /// <summary>
        /// 商户号
        /// </summary>
        [JsonPropertyName("merch_no")]
        public string? MerchNo { get; set; }

        /// <summary>
        /// 商户名称
        /// </summary>
        [JsonPropertyName("merch_name")]
        public string? MerchName { get; set; }
        
        /// <summary>
        /// 进件时间
        /// </summary>
        [JsonPropertyName("register_time")]
        public string? RegisterTime { get; set; }

        /// <summary>
        /// 商户状态
        /// </summary>
        [JsonPropertyName("merch_status")]
        public string? MerchStatus { get; set; }

        /// <summary>
        /// 产品类型
        /// </summary>
        [JsonPropertyName("product_type")]
        public string? ProductType { get; set; }

        /// <summary>
        /// 协议类型
        /// </summary>
        [JsonPropertyName("sign_mode")]
        public string? SignMode { get; set; }

        /// <summary>
        /// 服务商编号
        /// </summary>
        [JsonPropertyName("agent_id")]
        public string? AgentId { get; set; }

        // 进件结果
        /// <summary>
        /// 协议编号
        /// </summary>
        [JsonPropertyName("sign_id")]
        public string? SignId { get; set; }

        /// <summary>
        /// 协议链接
        /// </summary>
        [JsonPropertyName("sign_url")]
        public string? SignUrl { get; set; }

        // 经营信息
        /// <summary>
        /// 商户经营名称
        /// </summary>
        [JsonPropertyName("merch_shortname")]
        public string? MerchShortname { get; set; }

        /// <summary>
        /// 商户英文名称
        /// </summary>
        [JsonPropertyName("merch_english_name")]
        public string? MerchEnglishName { get; set; }

        /// <summary>
        /// 经营地址-省市区
        /// </summary>
        [JsonPropertyName("address_code")]
        public string? AddressCode { get; set; }

        /// <summary>
        /// 经营地址-详细地址
        /// </summary>
        [JsonPropertyName("address_detail")]
        public string? AddressDetail { get; set; }

        /// <summary>
        /// 所属行业
        /// </summary>
        [JsonPropertyName("mcc_code")]
        public string? MccCode { get; set; }

        // 结算设置
        /// <summary>
        /// 结算方式
        /// </summary>
        [JsonPropertyName("settle_mode")]
        public string? SettleMode { get; set; }

        /// <summary>
        /// 营业周期
        /// </summary>
        [JsonPropertyName("day_cut")]
        public string? DayCut { get; set; }

        /// <summary>
        /// 是否允许商户自主变更结算账户
        /// </summary>
        [JsonPropertyName("account_change_flag")]
        public string? AccountChangeFlag { get; set; }

        /// <summary>
        /// 结算附言
        /// </summary>
        [JsonPropertyName("postscript")]
        public string? Postscript { get; set; }

        /// <summary>
        /// 费率列表
        /// </summary>
        [JsonPropertyName("rate_info")]
        public List<Dictionary<string, object>>? RateInfo { get; set; }

        // 辅助证明材料
        /// <summary>
        /// 银行客户经理工号
        /// </summary>
        [JsonPropertyName("bank_server_id")]
        public string? BankServerId { get; set; }

        /// <summary>
        /// 银行编号
        /// </summary>
        [JsonPropertyName("bank_code")]
        public string? BankCode { get; set; }

        // 身份信息
        /// <summary>
        /// 主体类型
        /// </summary>
        [JsonPropertyName("merch_type")]
        public string? MerchType { get; set; }

        // 营业证明信息
        /// <summary>
        /// 执照类型
        /// </summary>
        [JsonPropertyName("license_type")]
        public string? LicenseType { get; set; }

        /// <summary>
        /// 注册号/统一社会信用代码
        /// </summary>
        [JsonPropertyName("license_no")]
        public string? LicenseNo { get; set; }

        /// <summary>
        /// 登记证书编号
        /// </summary>
        [JsonPropertyName("cert_number")]
        public string? CertNumber { get; set; }

        /// <summary>
        /// 商户法定名称
        /// </summary>
        [JsonPropertyName("license_name")]
        public string? LicenseName { get; set; }

        /// <summary>
        /// 经营范围
        /// </summary>
        [JsonPropertyName("business_scope")]
        public string? BusinessScope { get; set; }

        /// <summary>
        /// 注册地址
        /// </summary>
        [JsonPropertyName("license_address")]
        public string? LicenseAddress { get; set; }

        /// <summary>
        /// 有效期限开始日期
        /// </summary>
        [JsonPropertyName("period_begin")]
        public string? PeriodBegin { get; set; }

        /// <summary>
        /// 有效期限结束日期
        /// </summary>
        [JsonPropertyName("period_end")]
        public string? PeriodEnd { get; set; }

        // 经营者/法人信息
        /// <summary>
        /// 证件类型
        /// </summary>
        [JsonPropertyName("id_doc_type")]
        public string? IdDocType { get; set; }

        /// <summary>
        /// 经营者/法人姓名 (需要解密)
        /// </summary>
        [JsonPropertyName("id_card_name")]
        public string? IdCardName { get; set; }

        /// <summary>
        /// 经营者/法人英文名称 (需要解密)
        /// </summary>
        [JsonPropertyName("id_card_english_name")]
        public string? IdCardEnglishName { get; set; }

        /// <summary>
        /// 经营者/法人证件号码 (需要解密)
        /// </summary>
        [JsonPropertyName("id_card_no")]
        public string? IdCardNo { get; set; }

        /// <summary>
        /// 法人姓名 (需要解密)
        /// </summary>
        [JsonPropertyName("legal_person_name")]
        public string? LegalPersonName { get; set; }

        /// <summary>
        /// 经营者/法人手机号码 (需要解密)
        /// </summary>
        [JsonPropertyName("legal_person_phone")]
        public string? LegalPersonPhone { get; set; }

        /// <summary>
        /// 证件有效期开始时间
        /// </summary>
        [JsonPropertyName("card_period_begin")]
        public string? CardPeriodBegin { get; set; }

        /// <summary>
        /// 证件有效期结束时间
        /// </summary>
        [JsonPropertyName("card_period_end")]
        public string? CardPeriodEnd { get; set; }

        /// <summary>
        /// 获取敏感字段列表
        /// </summary>
        /// <returns>敏感字段列表</returns>
        public List<string> GetSensitiveFields()
        {
            return new List<string>
            {
                "id_card_name",           // 经营者/法人姓名
                "id_card_english_name",   // 经营者/法人英文名称
                "id_card_no",             // 经营者/法人证件号码
                "legal_person_name",      // 法人姓名
                "legal_person_phone",     // 经营者/法人手机号码
            };
        }
    }
} 